package com.hjw.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>Project:Academic - Book
 *
 * @author IvanWei玮 -- maste
 * @version 1.0
 * @DataTime 2025/1/20 16:56
 * @since 1.8
 */
@Getter
@Setter
public class Book implements Serializable {
    private int id;
    private String name;
    private String sn;
    private double price;
    private double price2;
    private String maker;
    /**
     * @ JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") 配置日期格式的方法
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date tmake;
    private Type type;
    private String pic;
    private String author;
    private int salenum;
    private int stock;
    private String info;
    private String info2;

    public Book() {
        this.id = 0;
        this.name = "";
        this.sn = "";
        this.price = 0.0;
        this.price2 = 0.0;
        this.maker = "";
        this.tmake = new Date();
        this.type = new Type();
        this.pic = "";
        this.author = "";
        this.salenum = 0;
        this.stock = 0;
        this.info = "";
        this.info2 = "";
    }

    @Override
    public String toString() {
        return "Book{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", sn='" + sn + '\'' +
                ", price=" + price +
                ", price2=" + price2 +
                ", maker='" + maker + '\'' +
                ", tmake=" + tmake +
                ", type=" + type +
                ", pic='" + pic + '\'' +
                ", author='" + author + '\'' +
                ", salenum=" + salenum +
                ", stock=" + stock +
                ", info='" + info + '\'' +
                ", info2='" + info2 + '\'' +
                '}';
    }
}
